]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: don't leak background objects during quick changes
authorRay Strode <rstrode@redhat.com>
Thu, 4 Apr 2013 20:12:31 +0000 (16:12 -0400)
committerRay Strode <rstrode@redhat.com>
Sat, 6 Apr 2013 13:44:50 +0000 (09:44 -0400)
We currently let some backgrounds "fall through the cracks" if
a bunch of change notifications come in at once.

This commit fixes that.

https://bugzilla.gnome.org/show_bug.cgi?id=697395

js/ui/background.js

index 88c79e2251c10d7e9af0d8fb2c7a83d675cca02b..4994c05a3518d5bd0e67da3638946c38a278e988 100644 (file)
@@ -742,11 +742,15 @@ const BackgroundManager = new Lang.Class({
                                    time: FADE_ANIMATION_TIME,
                                    transition: 'easeOutQuad',
                                    onComplete: Lang.bind(this, function() {
-                                       if (this.background == background) {
+                                       if (this._newBackground == newBackground) {
                                            this.background = newBackground;
                                            this._newBackground = null;
-                                           background.actor.destroy();
+                                       } else {
+                                           newBackground.actor.destroy();
                                        }
+
+                                       background.actor.destroy();
+
                                        this.emit('changed');
                                    })
                                  });